package com.javacv.plus.extensions.video.steps;

import com.javacv.plus.core.processor.ProcessorContext;
import com.javacv.plus.core.processor.ProcessorStep;
import com.javacv.plus.extensions.video.VideoProcessor;
import com.javacv.plus.extensions.video.VideoResult;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class VideoResizeStep implements ProcessorStep<VideoProcessor, VideoResult> {
    
    private final int width;
    private final int height;
    
    public VideoResizeStep(int width, int height) {
        this.width = width;
        this.height = height;
    }
    
    @Override
    public VideoResult execute(VideoProcessor processor, ProcessorContext context) throws Exception {
        log.info("调整视频分辨率: {}x{}", width, height);
        context.setAttribute("resize_width", width);
        context.setAttribute("resize_height", height);
        return null;
    }
    
    @Override
    public String getStepName() {
        return "VideoResize";
    }
} 